package com.burst.reptile.modular.zp.service.impl;

import com.burst.reptile.common.utils.ToolUtil;
import com.burst.reptile.modular.app.vo.FollowVo;
import com.burst.reptile.modular.zp.entity.ZpFans;
import com.burst.reptile.modular.zp.mapper.ZpFansMapper;
import com.burst.reptile.modular.zp.service.IZpFansService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户粉丝列表 服务实现类
 * </p>
 *
 * @author wujin
 * @since 2020-06-19
 */
@Service
public class ZpFansServiceImpl extends ServiceImpl<ZpFansMapper, ZpFans> implements IZpFansService {

	@Override
	public Page<ZpFans> pageList(Page<ZpFans> page, ZpFans fans) {
		Long userId = fans.getUserId();
		QueryWrapper<ZpFans> queryWrapper = new QueryWrapper<>();
		if(ToolUtil.isNotEmpty(userId)) {
			queryWrapper.eq("user_id", userId);
		}
		return this.page(page, queryWrapper);
	}

	@Override
	public Page<FollowVo> fanslist(Page<FollowVo> page, Long userId, String key) {
		return this.baseMapper.fanslist(page, userId, key);
	}

}
